
class ContainerClass(object):
	data={}
    	instances = {}
    	def __new__(cls, *args, **kargs): 
        	if ContainerClass.instances.get(cls) is None:
			ContainerClass.instances[cls] = object.__new__(cls, *args, **kargs)
        	return ContainerClass.instances[cls]
	def reset(self):
		"""Resets all data"""
		self.data={}
	def dump(self,set=False):
		if set:
			object.__setattr__(self,'data',set)
		else:
			return self.data
		
	def __setattr__(self,attr,key,*unexpected):
		self.data[attr]=key
	def __getattr__(self,attr,*unexpected):
		if not attr in self.data:
			return None
		return self.data[attr]
	def __delattr__(self, attr):
		if attr in self.data:
			del self.data[attr]
	def __contains__(self,x):
		if x in self.data:
			return True
		else:	return False

class Option(ContainerClass):
	data={}
	"""
	Global singleton. It acts as a global storage for user options.
	
	Preferred usage is:
		>>> Option().key=value # Setter
		>>> print Option().key # Getter

	If you want to check Option object against existence of an option, use:
		>>> if 'key' in Option()
	"""
	pass

